﻿using UnityEngine;
using System.Collections;

public class Shell : MonoBehaviour
{
    [HideInInspector] public Vector2 m_vecOwnerPos;
    private float m_fCurrentTime = 0.0f;
    private Vector2 MovePos;

    void Awake()
    {

        MovePos = new Vector3(transform.position.x + Random.Range(0.01f, 1.0f), transform.position.y, transform.position.z);

    }

    void Update()
    {
        m_fCurrentTime += Time.deltaTime;

        if (m_fCurrentTime > 0.1f)
            gameObject.GetComponent<SpriteRenderer>().sortingLayerName = "Effect";
        else
            Calculate.MoveToDest(gameObject, new Vector3(transform.position.x + Random.Range(0.02f, 0.05f), transform.position.y, transform.position.z), 5.0f);
       
    }
}
